import 'package:get/get.dart';
import 'package:lishopflu/aaa/test_screen.dart';
import 'package:lishopflu/aaa/test_screen_controller.dart';
import 'package:lishopflu/page/address/add_address_ctl.dart';
import 'package:lishopflu/page/address/add_address_page.dart';
import 'package:lishopflu/page/address/address_choose_ctl.dart';
import 'package:lishopflu/page/address/address_choose_page.dart';
import 'package:lishopflu/page/address/address_manage_ctl.dart';
import 'package:lishopflu/page/address/address_manage_page.dart';
import 'package:lishopflu/page/common/amap_page.dart';
import 'package:lishopflu/page/common/photo_ctl.dart';
import 'package:lishopflu/page/common/photo_page.dart';
import 'package:lishopflu/page/login/login_ctl.dart';
import 'package:lishopflu/page/login/login_page.dart';
import 'package:lishopflu/page/main/home_ctl.dart';
import 'package:lishopflu/page/main/home_page.dart';
import 'package:lishopflu/page/main/main_ctl.dart';
import 'package:lishopflu/page/main/main_page.dart';
import 'package:lishopflu/page/main/message_ctl.dart';
import 'package:lishopflu/page/main/message_page.dart';
import 'package:lishopflu/page/main/my_ctl.dart';
import 'package:lishopflu/page/main/my_page.dart';
import 'package:lishopflu/page/main/shop_car_ctl.dart';
import 'package:lishopflu/page/main/shop_car_page.dart';
import 'package:lishopflu/page/main/story_ctl.dart';
import 'package:lishopflu/page/main/story_page.dart';
import 'package:lishopflu/page/order/order_confirm_ctl.dart';
import 'package:lishopflu/page/order/order_confirm_page.dart';
import 'package:lishopflu/page/personal/change_phone_ctl.dart';
import 'package:lishopflu/page/personal/change_phone_page.dart';
import 'package:lishopflu/page/personal/person_info_ctl.dart';
import 'package:lishopflu/page/personal/person_info_page.dart';
import 'package:lishopflu/page/product/home_search_ctl.dart';
import 'package:lishopflu/page/product/home_search_page.dart';
import 'package:lishopflu/page/product/product_detail_ctl.dart';
import 'package:lishopflu/page/product/product_detail_page.dart';
import 'package:lishopflu/page/settings/setting_ctl.dart';
import 'package:lishopflu/page/settings/setting_page.dart';
import 'package:lishopflu/page/splash/no_found_page.dart';
import 'package:lishopflu/page/splash/splash_ctr.dart';
import 'package:lishopflu/page/splash/splash_page.dart';

class AppPages {

  static const SPLASH = '/splash_page';
  static const TEST = '/test_screen';
  static const NotFound = '/notfound';
  static const MAIN = '/main_page';
  static const HOME = '/home_page';
  static const STORY = '/story_page';
  static const MESSAGE = '/message_page';
  static const SHOP_CART = 'shop_car_page';
  static const MY = '/my_page';
  static const HOME_SEARCH = '/home_search';
  static const PRODUCT_DETAIL = '/product_detail_page';
  static const ORDER_CONFIRM = '/order_confirm_page';
  static const PHOTO = '/photo_page';
  static const SETTING = '/setting_page';
  static const ADDRESS_MANAGE = '/address_manage_page';
  static const ADDRESS_CHOOSE = '/address_choose_page';
  static const ADD_ADDRESS = '/add_address_page';
  static const AMAP = '/amap_page';
  static const PERSON_INFO = '/person_info_page';
  static const CHANGE_PHONE = '/change_phone_page';
  static const LOGIN = '/login_page';


//  BindingsBuilder (() => Get.lazyPut (() => UserController ()))
//  or
//  BindingsBuilder.put (() => UserController ())

  static final unknownRoute = GetPage(
    name: NotFound,
    page: () => NoFoundPage(),
  );

  static final routes = [
    GetPage(
      name: SPLASH,
      page: () => SplashPage(),
      binding: BindingsBuilder.put (() => SplashCtl())
    ),
    GetPage(
      name: TEST,
      page: () => TestScreen(),
      binding: BindingsBuilder.put (() => TestScreenController())
    ),
    GetPage(
      name: MAIN,
      page: () => MainPage(),
      binding: BindingsBuilder.put (() => MainCtl()),
      children: [
        GetPage(
          name: HOME,
          page: () => HomePage(),
          binding: BindingsBuilder.put (() => HomeCtl()),
        ),
        GetPage(
          name: STORY,
          page: () => StoryPage(),
          binding: BindingsBuilder.put (() => StoryCtl()),
        ),
        GetPage(
          name: MESSAGE,
          page: () => MessagePage(),
          binding: BindingsBuilder.put (() => MessageCtl()),
        ),
        GetPage(
          name: SHOP_CART,
          page: () => ShopCarPage(),
          binding: BindingsBuilder.put (() => ShopCarCtl()),
        ),
        GetPage(
          name: MY,
          page: () => MyPage(),
          binding: BindingsBuilder.put (() => MyCtl()),
        ),
      ]
    ),
    GetPage(
      name: HOME_SEARCH,
      page: () => HomeSearchPage(),
        binding: BindingsBuilder.put (() => HomeSearchCtl())
    ),
    GetPage(
      name: PRODUCT_DETAIL,
      page: () => ProductDetailPage(),
        binding: BindingsBuilder.put (() => ProductDetailCtl())
    ),
    GetPage(
      name: ORDER_CONFIRM,
      page: () => OrderConfirmPage(),
        binding: BindingsBuilder.put (() => OrderConfirmCtl())
    ),
    GetPage(
      name: PHOTO,
      page: () => PhotoPage(),
        binding: BindingsBuilder.put (() => PhotoCtl())
    ),
    GetPage(
      name: SETTING,
      page: () => SettingPage(),
        binding: BindingsBuilder.put (() => SettingCtl())
    ),
    GetPage(
      name: ADDRESS_MANAGE,
      page: () => AddressManagePage(),
        binding: BindingsBuilder.put (() => AddressManageCtl())
    ),
    GetPage(
      name: ADDRESS_CHOOSE,
      page: () => AddressChoosePage(),
        binding: BindingsBuilder.put (() => AddressChooseCtl())
    ),
    GetPage(
      name: ADD_ADDRESS,
      page: () => AddAddressPage(),
        binding: BindingsBuilder.put (() => AddAddressCtl())
    ),
    GetPage(
      name: AMAP,
      page: () => AmapPage(),
//        binding: BindingsBuilder.put (() => AmapCtl())
    ),
    GetPage(
        name: PERSON_INFO,
        page: () => PersonInfoPage(),
        binding: BindingsBuilder.put (() => PersonInfoCtl())
    ),
    GetPage(
        name: CHANGE_PHONE,
        page: () => ChangePhonePage(),
        binding: BindingsBuilder.put (() => ChangePhoneCtl())
    ),
    GetPage(
        name: LOGIN,
        page: () => LoginPage(),
        binding: BindingsBuilder.put (() => LoginCtl())
    ),
  ];
}
